package com.hdoit.apollo.web.shop.modelconfig;

import com.hdoit.apollo.web.shop.providers.CustomerProvider;
import com.hdoit.apollo.web.shop.providers.CustomerRecordTypeProvider;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RequiredAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      tancongzhu
 * @email       
 * @createtime  2018年06月08日 15:14:39
 * @comment
 */
public class CustomerRecordConfig extends ModelMetadataAttributeConfiguration{
    public CustomerRecordConfig(){
        this.setProperty("customerId")
            .hasAttribute(new DisplayNameAttribute("客户Id"))
	    	.hasAttribute(new DropDownListAttribute(new CustomerProvider()))
	    	.hasAttribute(new RequiredAttribute("必填"));

        this.setProperty("receivable")
            .hasAttribute(new DisplayNameAttribute("应收"));

        this.setProperty("receipt")
            .hasAttribute(new DisplayNameAttribute("收款"))
            .hasAttribute(new RequiredAttribute("必填"));

        this.setProperty("type")
            .hasAttribute(new DisplayNameAttribute("类型"))
            .hasAttribute(new DropDownListAttribute(new CustomerRecordTypeProvider()));

        this.setProperty("operateId")
            .hasAttribute(new DisplayNameAttribute("操作Id"));

        this.setProperty("accumulativeDebt")
            .hasAttribute(new DisplayNameAttribute("累计欠款"));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店id"));

        this.setProperty("comment")
            .hasAttribute(new DisplayNameAttribute("备注"));

    }
}